package com.team.work.dao;


import com.team.work.entities.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TypeRepository extends JpaRepository<Type, Long> {
    //不允许添加同样的标签 查数据库 如果查到了就提示已存在
    Type findByName(String name);
//各个类的展示
    @Query("select t from Type t")
    List<Type> findTop(Pageable pageable);

}
